package Controll;

import java.io.IOException;
import java.sql.SQLException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import Dao.Comment;
import Dao.CommentDao;

public class SCommentServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
	public static List<Comment> sList;

	public SCommentServlet() {
		super();
	}

	protected void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		CommentDao commentDao = new CommentDao();
		try {
			sList = commentDao.squery();
			request.setAttribute("commt", sList);
		} catch (SQLException e) {
			e.printStackTrace();
		}
		request.getRequestDispatcher("mountainSong.jsp").forward(request, response);
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		doGet(request, response);
	}

}
